package com.trsjh.db.domains;
// Generated 2012-1-13 12:55:11 by Hibernate Tools 3.4.0.CR1


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Actor generated by hbm2java
 */
@Entity
@Table(name="actors"
,catalog="myglass"
, uniqueConstraints = @UniqueConstraint(columnNames="job") 
		)
public class Actor  implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4372643671370334808L;
	public static final String SALLER="s";
	public static final String OPTOMETRIST="o";
	public static final String WORKER="w";
	public static final String BOSS="b+";
	public static final String SECONDARYBOSS="b-";
	public static final String ADMIN="a";
	
	
	@Id @GeneratedValue(strategy=IDENTITY)
	@Column(name="id", unique=true, nullable=false)
	private Integer id;
	
	@Column(name="job", unique=true, nullable=false, length=20)   
	private String job;    
	
	@ManyToMany(fetch=FetchType.LAZY)
	@JoinTable(name="users_has_actors",  joinColumns = { 
			@JoinColumn(name="actors_id", nullable=false, updatable=false) }, inverseJoinColumns = { 
			@JoinColumn(name="users_id", nullable=false, updatable=false) })
	private Set<User> users = new HashSet<User>(0);

	public Actor() {
	}
	public Actor(String job) {
		this.job = job;
	}
	public Actor(String job, Set<User> users) {
		this.job = job;
		this.users = users;
	}
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}


	public String getJob() {
		return this.job;
	}

	public void setJob(String job) {
		this.job = job;
	}


	public Set<User> getUsers() {
		return users;
	}


	public void setUsers(Set<User> users) {
		this.users = users;
	}






}
